from hcsr04 import HCSR04
import time
sensor = HCSR04(trigger_pin=5, echo_pin=4)
while 1:
    distancecm = sensor.distance_cm()
    #distancemm = sensor.distance_mm()
    print('Distance:', distancecm, 'cm')
    #print('Distance:', distancemm, 'mm')
    time.sleep_ms(500)
